<?php

/**
 * Описание класса DataBase
 *
 * 
 * @author		Marat Mitypov
 * @link		http://www.mitypov.ru
 * @copyright		2011 Marat Mitypov (marat@mitypov.ru)
 * @license		GNU General Public License 3 (http://www.gnu.org/licenses/)
 * @version             $Id: DataBase.class.php 3 2011-11-30 12:00:32Z marat@mitypov.ru $
 */

class DataBase {
    private $host, $usernane, $password, $port;
    
    public function __construct($iHost='localhost', $iPort='3306', $iUserName='test', $iPassword='') {
        $this->host = $iHost;
        $this->port = $iPort;
        $this->usernane = $iUserName;
        $this->password = $iPassword;
    }
    
    public function Connect(){
        mysql_connect($this->host, $this->usernane, $this->password)
                OR die ("Database connect problem");
    }
    
    public function ChengeDB($DatabaseName) {
        mysql_select_db($DatabaseName)
            OR die("Database select is problem");
    }
    
    public function SetDBCharset($Charset) {
        //TODO: set database charset
    }
    
    public function Query($sql) {
        //TODO: write query code
    }
}

?>
